package com.example.javafx.titlePane;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.CheckBox;
import javafx.scene.control.TitledPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;

public class Main extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {

        Scene scene = new Scene(new Group(),350,250);
        TitledPane titledPane = new TitledPane("My Title ",new CheckBox("OK"));

        HBox hBox = new HBox(10);
        hBox.setPadding(new Insets(20,0,0,20));
        hBox.getChildren().add(titledPane);

        Group root = (Group) scene.getRoot();
        root.getChildren().add(hBox);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
